<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>
    ESP8266网页配网
  </title>
</head>

<body>
  <form name="my">
    WiFi名称：
    <input type="text" name="s" placeholder="请输入您WiFi的名称" id="aa">
    <br>
    WiFi密码：
    <input type="text" name="p" placeholder="请输入您WiFi的密码" id="bb">
    <br>
    <input type="button" value="连接" onclick="wifi()">
  </form>
  <script language="javascript">
    function wifi() {
      var ssid = my.s.value;
      var password = bb.value;
      var xmlhttp = new XMLHttpRequest();
      xmlhttp.open("POST", "/set", true);
      xmlhttp.send("ssid=" + ssid + "&password=" + password)
    }
  </script>
</body>

</html>